import 'package:flutter/material.dart';

import '../constants/color_constants.dart';
import '../pages/map/map_location_page.dart';


class MyInfoCell extends StatelessWidget {


   final String? imageName;
   final String? subImageName;
   final String? title;
   final String? subTitle;
   final Widget? child;


  MyInfoCell({@required this.imageName, this.subImageName,@required this.title, this.subTitle,@required this.child});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: (){
        Navigator.of(context).push(
            MaterialPageRoute(builder: (_)=>child!)
        );
      },
      child: Container(
        margin: EdgeInsets.only(left: 10,right: 10),
        height: 60,
        color: Colors.white,
        child: Column(
          children: [
            Container(child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Container(
                  padding: EdgeInsets.all(10),
                  child: Row(
                    children: [
                      Image(image: AssetImage(imageName!),width: 25,),
                      SizedBox(width: 10,),
                      Text(title!,style: TextStyle(fontSize: 16),)
                    ],
                  ),
                ),
                Container(
                  padding: EdgeInsets.all(10),
                  child: Row(
                    children: [
                      subTitle!=null ? Text(subTitle!):Text(""),
                      subImageName!=null ? Image.asset(subImageName!,width: 5,):Container(),
                      Image(image: AssetImage("images/arrow_right_icon.png"),width: 15,)
                    ],
                  ),
                )
              ],
            ),),
             Container(child: const Divider(
              height: 10, // 分隔线的高度
              thickness: 0.5, // 分隔线的厚度
              color: ColorConstants.themeColor,
            ),)
          ],
        ),
      ),
    );
  }
}
